Talk:SpoilerAlert
How to trigger There's no instructions given on how to trigger this function to pop up on a window. I'm not going to rename my pages where I want to use this to Spoiler:Pagename. That's ridiculous. How does SpoilerAlert/Demo trigger it? It is not called Spoiler:Anything (close, but no ":" in "SpoilerAlert". I tried copying the line from the Demo source: " " as it would make sense if the code checked for some div id... but it didn't work. Please advise, Thanks, PS. When I didn't use the nowiki tags on the div id above, this page prompted the Spoiler Alert dialog to pop up. PPS. On both the demo and this page, clicking on No, not yet or Yes please does nothing - the dialog just stays there. I assumed for the demo it was because there was no page data to dispay, but the dialog refused to go away on this talk page. Also this text still showed below the dialog box. So I really don't think this code is working too well. :You don't have to rename your pages. That was just an example. All you need to do, is provide your own isSpoiler function. That function tells SpoilerAlert whether it should display the dialog or not. If you tell me how you want to trigger SpoilerAlert I'll write an isSpoiler function for you! :) :You say, you clicked on both "no" and "yes" but the dialog did not disappear? That's strange. I just tested the demo and it does work for me. Can you tell me what other scripts you're using and where you've added them? -- pecoes 16:23, July 14, 2012 (UTC) Cool! I was just going to try it out on: w:c:ParadiseIslandHD:Upcoming buildings and features and I don't forsee using it on any other page (our site(s) don't really have much use for it - but I happened across your code and thought I'd chuck it on). I have a box at the top of that page, I figured it could still stay there after the dialog pop-up disappears. So how about it triggers on any page that the template is on? Re: What other scripts I have? I just clicked on SpolierAlert/Demo here on this site, so whatever scripts I have on other sites would be irrelevant... I use IE9, it shows the dialog at the top of the page, the clear cache and reload underneath it, and this is a demo text below that. I just opened it in Chrome and it works properly... :Okay, I've modified the template a little. Add this to your MediaWiki:Common.js: window.SpoilerAlert = { isSpoiler: function () { return Boolean($('#spoiler').length); } }; importScriptPage('SpoilerAlert/code.js', 'dev'); :pecoes 16:56, July 14, 2012 (UTC) ::I can confirm that SpoilerAlert is broken in IE9! I'll get back to you when I have a fix! -- pecoes 17:17, July 14, 2012 (UTC) :::Correction: It does work in IE9. I had to clear my cache though. -- pecoes 17:44, July 14, 2012 (UTC)